package com.mars.simple.push.controller;

import com.mars.push.core.request.PushRequest;
import com.mars.push.core.service.impl.HuaweiPushImpl;
import com.mars.push.core.service.impl.OppoPushServiceImpl;
import com.mars.push.core.service.impl.VivoPushServiceImpl;
import com.mars.push.core.service.impl.XiaomiPushServiceImpl;
import com.mars.simple.push.service.PushService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author wq
 * @version 1.0
 * @date 2021/03/08 15:25
 */
@RestController
@RequestMapping("/push")
public class PushController {

    @Resource
    private PushService pushService;


    /**
     * 消息推送
     *
     * @param request request
     * @return String
     */
    @PostMapping("/singlePush")
    public String singlePush(@RequestBody PushRequest request) {
        pushService.singlePush(request);
        return "success";
    }

}
